import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../public.dart';

/// widget
class WidgetProvider {
  static WidgetProvider _instance;
  WidgetProvider._internal();

  static WidgetProvider getInstance() {
    if (_instance == null) {
      _instance = WidgetProvider._internal();
    }
    return _instance;
  }

  /// 首页
  ChangeNotifierProvider<HomeProvider> getHomePage(Widget child) {
    return ChangeNotifierProvider<HomeProvider>(
      create: (context) => HomeProvider(),
      child: child,
    );
  }
}
